\documentclass[11pt,a4paper]{report}

% Required packages
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{graphicx}

% Define simple Unicode symbols for compatibility
\newcommand{\unicodecheck}{\checkmark}
\newcommand{\unicodewarn}{!}
\usepackage{booktabs}
\usepackage{array}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{url}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{geometry}
\usepackage{enumitem}
\setlistdepth{20}

% Simplified list environment setup to prevent indentation accumulation
\makeatletter
% Use enumitem's built-in reset mechanism instead of custom definitions
\setlist[itemize]{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=*}
\setlist[enumerate]{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=*}
\setlist[description]{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=*}
\makeatother

% Enhanced hyphenation for procedure names
\hyphenation{Ob-ser-va-tion Di-ag-nos-tics An-al-y-sis In-cre-ments}
\hyphenation{Sat-el-lite Tem-po-ral Meta-da-ta Tim-ing QC In-no-va-tion}
\hyphenation{Sta-tis-tics Di-ag-nos-tic Au-to-ma-ted En-sem-ble Co-var-i-ance}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta,positioning}

% Define tikz arrow style
\tikzset{
    arrow/.style={thick,->,>=stealth}
}

% Page setup
\geometry{margin=1in}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt}
\setlength{\headheight}{13.59999pt}

% Global indentation reset to prevent accumulation
\makeatletter
\AtBeginDocument{
  \setlength{\leftmargini}{2.5em}
  \setlength{\leftmarginii}{2.2em}
  \setlength{\leftmarginiii}{1.87em}
  \setlength{\leftmarginiv}{1.7em}
  \setlength{\leftmarginv}{1.5em}
  \setlength{\leftmarginvi}{1.5em}
  \setlength{\leftmarginvii}{1.5em}
  \setlength{\leftmarginviii}{1.5em}
}
\makeatother

% Header/footer setup
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO]{\rightmark}
\fancyhead[RE]{\leftmark}

% Code listing setup
\lstset{
    basicstyle=\ttfamily\small,
    breaklines=true,
    frame=single,
    numbers=left,
    numberstyle=\tiny,
    keywordstyle=\color{blue},
    commentstyle=\color{green!60!black},
    stringstyle=\color{red},
    showstringspaces=false
}

% Define Julia language for listings
\lstdefinelanguage{Julia}{
    keywords=[1]{function,if,else,elseif,end,for,while,return,true,false,struct,mutable,abstract,type,const,local,global,module,using,import,export},
    keywords=[2]{Int,Float64,String,Bool,Array,Vector,Matrix,Dict,Tuple},
    sensitive=true,
    morecomment=[l]{\#},
    morestring=[b]",
    morestring=[b]'
}

% Algorithm command definitions
\algdef{SE}[PARFOR]{ParFor}{EndParFor}[1]{\algorithmicfor\ #1\ \algorithmicdo\ \textbf{in parallel}}{\algorithmicend\ \algorithmicfor}
\algdef{SE}[SWITCH]{Switch}{EndSwitch}[1]{\algorithmicswitch\ #1}{\algorithmicend\ \algorithmicswitch}
\algdef{S}[CASE]{Case}[1]{\algorithmiccase\ #1:}
\algdef{S}[DEFAULT]{Default}{\algorithmicdefault:}

% Define algorithmic keywords for switch statements
\newcommand{\algorithmicswitch}{\textbf{switch}}
\newcommand{\algorithmiccase}{\textbf{case}}
\newcommand{\algorithmicdefault}{\textbf{default}}

% Define COMMENT command for algorithms
\newcommand{\COMMENT}[1]{\State \textit{// #1}}


% Hyperref setup
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=cyan,
    pdftitle={GSI/EnKF Technical Report},
    pdfauthor={GSI/EnKF Documentation System},
    pdfsubject={Data Assimilation Systems Technical Documentation}
}

% Title page information
\title{
    \vspace{2cm}
    \huge\textbf{GSI/EnKF Data Assimilation Systems}\\
    \vspace{0.5cm}
    \Large Technical Reference Manual\\
    \vspace{1cm}
    \large Gridpoint Statistical Interpolation and\\
    Ensemble Kalman Filter Implementation Guide
}

\author{
    \textbf{GSI/EnKF Documentation Project}\\
    \vspace{0.5cm}
    Based on comGSI v3.7 and EnKF v1.3\\
    \vspace{0.5cm}
    \today
}

\date{}

\begin{document}

% Title page
\maketitle
\thispagestyle{empty}

% Table of contents
\tableofcontents
\newpage

% List of figures
\listoffigures
\newpage

% List of tables
\listoftables
\newpage

% Part and Chapter includes

\part{System Overview and Theory}
\input{part1/ch01_introduction}
\input{part1/ch02_mathematical_foundations}
\input{part1/ch03_system_comparison}

\part{GSI Analysis System}
\input{part2/ch04_gsi_main_process}
\input{part2/ch05_initialization_setup}
\input{part2/ch06_core_analysis_loop}
\input{part2/ch07_observation_pipeline}

\part{Core Analysis Components}
\input{part3/ch08_preconditioned_cg}
\input{part3/ch09_cost_function_framework}
\input{part3/ch10_control_state_transforms}
\input{part3/ch11_gradient_computation}

\part{Background Error and Grid Operations}
\input{part4/ch12_background_error}
\input{part4/ch13_grid_operations}
\input{part4/ch14_interpolation_smoothing}
\input{part4/ch15_balance_constraints}

\part{Observation Systems}
\input{part5/ch16_observation_ingestion}
\input{part5/ch17_conventional_data}
\input{part5/ch18_satellite_radiance}
\input{part5/ch19_specialized_observations}

\part{EnKF System}
\input{part6/ch20_enkf_architecture}
\input{part6/ch21_letkf_algorithm}
\input{part6/ch22_ensemble_management}
\input{part6/ch23_enkf_gsi_integration}

\part{DRP-4DVar Framework}
\input{part7/ch24_drp4dvar_architecture}
\input{part7/ch25_ensemble_projection}
\input{part7/ch26_low_dimensional_minimization}
\input{part7/ch27_etkf_ensemble_updates}

\part{Utilities and Supporting Systems}
\input{part8/ch28_data_structures}
\input{part8/ch29_computational_utilities}
\input{part8/ch30_io_format_handling}

\part{Advanced Observation Processing}
\input{part9/ch31_data_readers_framework}
\input{part9/ch32_observation_operators}
\input{part9/ch33_integration_computation}
\input{part9/ch34_step_calculation_qc}

\part{Input/Output Interface Systems}
\input{part10/ch35_model_interfaces}
\input{part10/ch36_file_format_handling}
\input{part10/ch37_ensemble_io_systems}
\input{part10/ch38_diagnostic_output}

\part{Julia Implementation Architecture}
\input{part11/ch39_julia_package_experiments}
\input{part11/ch40_enkf_integration_diagnostics}
\input{part11/ch41_data_structures_memory}
\input{part11/ch42_parallel_distributed}
\input{part11/ch43_observation_processing}
\input{part11/ch44_advanced_analysis_hybrid}
\input{part11/ch45_diagnostic_interoperability}
\input{part11/ch46_performance_integration_roadmap}
\input{part11/ch47_gsi_julia_experimental_validation}

% Bibliography
\begin{thebibliography}{99}

\bibitem{gsi_userguide}
GSI Development Team, \textit{GSI User's Guide Version 3.7.0}, 
National Centers for Environmental Prediction, 2019.

\bibitem{gsi_advanced}
GSI Development Team, \textit{Advanced GSI User's Guide Version 3.5.0.0}, 
National Centers for Environmental Prediction, 2017.

\bibitem{enkf_userguide}
Liu, H., M. Hu, D. Stark, H. Shao, G. Ge, K. Newman, and J. Whitaker, 
\textit{Ensemble Kalman Filter (EnKF) User's Guide Version 1.2}, 
Developmental Testbed Center, 2017.

\bibitem{drp4dvar}
DRP-4DVar Development Team, \textit{Dimension-Reduced Projection 4D-Variational Method}, 
Technical Documentation, 2024.

\bibitem{gsi_theory}
Kleist, D. T., D. F. Parrish, J. C. Derber, R. Treadon, W. S. Wu, and S. Lord,
\textit{Introduction to the GSI}, 
NCEP Office Note 474, 2009.

\end{thebibliography}

% Appendices
\appendix

\chapter{GSI Component Classification}
\label{app:classification}

This appendix provides a complete listing of the 28 core analysis components identified in the GSI codebase classification system.

\chapter{Acronyms and Abbreviations}
\label{app:acronyms}

\begin{description}
\item[3DVAR] Three-Dimensional Variational Data Assimilation
\item[4DVAR] Four-Dimensional Variational Data Assimilation
\item[DRP-4DVar] Dimension-Reduced Projection 4D-Variational
\item[EnKF] Ensemble Kalman Filter
\item[ETKF] Ensemble Transform Kalman Filter
\item[GSI] Gridpoint Statistical Interpolation
\item[LETKF] Local Ensemble Transform Kalman Filter
\item[NMC] National Meteorological Center
\item[NCEP] National Centers for Environmental Prediction
\item[NOAA] National Oceanic and Atmospheric Administration
\item[NWP] Numerical Weather Prediction
\item[BUFR] Binary Universal Form for the Representation of meteorological data
\item[MPI] Message Passing Interface
\item[WRF] Weather Research and Forecasting Model
\end{description}


\end{document}